Dual controller support
While I was refactoring the raycaster and object highlight code, I wondered "Alright, this works fine for one controller but what if 2 point at different objects at the same time?"
Well the answer was simple. Nothing.
I had completely forgotten to implement the second controller. So, better get on it then.
While overhauling the controller code, I also made so to optimize how data is stored and made lots more used of the eventlisteners connected to each controller. Before I had a few global variables to store which object was highlighted, which also acted as a link to the object selected. This caused issues with multiple controllers since they would overwrite the same object each frame.
So I moved data to the controller objects themselves. This makes sure that collosions are pretty much impossible and also makes the code a lot more reusable.
Moving the data to the controllers also reintroduced an older bug that I had fixed. Namely the stems turning back on/off on each frame when holding the trigger down.
The culprit was a global variable I missed. Once I moved that to the controller object it worked perfectly fine.
That's it for this one, nice and short. Catch me tomorrow when I try my best at an English listening exam.